<template>
	<view class="content pc-tou-gao " >
		<view class="scroll-fix" >

		
			<view class="d-kuan-juzhong ">
				<!--头部-->
				<view class="d-kuan pc-dingbu ">
					<DToubu 
					@login-success="handleLoginSuccess" 
					@logout-success="handleLogout"
					:dengluxianshi="denglu_xianshi"
					@update-dengluxianshi="handleUpdateDengluxianshi"
					></DToubu>
					
				</view>
				


				<!--头部-->
				<!--下面内容-->
				<view class="d-kuan d-clear">
					<uv-row customStyle="margin-bottom: 10px" :gutter="10">
						<uv-col span="2" class="pc-yincang">
							<!--左边导航-->
							<view class="d-daohang d-you-10 pc-yincang d-y-gundong d-shang-20" id="zuo-daohang" :style="{height: leftNavHeight}">
								<view class="d-daohang-5 " >
									<Ddaohang 
									@denglu-fabu="denglu_fabu"
									
									></Ddaohang>
								</view>
							</view>
						</uv-col>

						<uv-col :span="kuan_shu">
							<!--头部背景-->
															
							<view class="pc-neikuang-20-list" >
									<view class="d-kuan   d-fu-shang-10 d-yuanjiao-20-20" :style="{opacity: dataLoaded ? '1' : '0', transition: 'opacity 0.5s ease-in-out'}">
										<view class="d-fu-zuoyou-10">
											<view class="d-gao-250 relative d-yuanjiao-20-20" style="background-image: url('/static/img/beijing000.jpg'); background-size: cover; background-repeat: no-repeat; background-position: center;">
												<view class="d-kuan ">
													<view class="d-neikuang-10 ">

														<view class=" d-shang-20 d-you" >
															<view class="d-you-20 ">
															    <uv-icon  @click="shezhi" name="list" color="#ffffff" size="18" labelColor="#ffffff" label="设置"></uv-icon>


															</view>
														</view>
													</view>
												</view>
												<view class="d-kuan d-buhuanhang">
													<view class="d-kuang-100 d-shangxia-juzhong d-zuo-20 d-yuanjiao-50">
														<image :src="u_data.wo && u_data.wo.avatar" class="d-yuanjiao-50" style="width: 50px; height: 50px;" mode="aspectFill"></image>

														
													</view>
													<view class="d-kuan " style="margin-top: 25px;">
														<view class="d-wenzi-yanse-bai-0 d-jiacu d-zuo-10">
															{{ u_data.wo && (u_data.wo.name || u_data.wo.username)}}
														</view>
						
														<view class="d-shang-5 d-wenzi-yanse-bai-0 d-buhuanhang">
															<view v-for="(list,index) in u_data.wo && u_data.wo.group_name" class="d-zuo-10 cu-tag round line-green sm">{{ list }}</view>
															

														</view>
														<!--view class="d-kuan d-shang-5">
															
															<uv-avatar-group :urls="quan_data" size="24" gap="0.3"></uv-avatar-group>

														</view-->
														<!--view class="d-shang-5 d-buhuanhang d-wenzi-yanse-bai-0"> 
														
															<uv-icon name="file-text" color="#ffffff" labelColor="#ffffff" size="26" ></uv-icon>
															
														</view-->
													</view>
													<view class="d-kuang-100 d-shangxia-juzhong d-you-20">
														<!--设置-->
													</view>
													

														
												</view>
												 
												<uv-row customStyle="margin-bottom: 10px">
													<uv-col span="3" customStyle="display: flex; justify-content: center; align-items: center;">
														<uv-count-to color="#ffffff" :startVal="0" :endVal="u_data.tiezi"></uv-count-to>
														<uv-icon name="order"  color="#ffffff" labelColor="#ffffff" size="24" label="帖子"></uv-icon>
													</uv-col>
													<uv-col span="3" customStyle="display: flex; justify-content: center; align-items: center;">
														<uv-count-to color="#ffffff" :startVal="0" :endVal="u_data.quanzi"></uv-count-to>
														<uv-icon name="heart" color="#ffffff" labelColor="#ffffff" size="20"  label="圈子"></uv-icon>
													</uv-col>
													<uv-col span="3" customStyle="display: flex; justify-content: center; align-items: center;">
														<uv-count-to color="#ffffff" :startVal="0" :endVal="u_data.guanzhu"></uv-count-to>
														<uv-icon name="plus" color="#ffffff" labelColor="#ffffff" size="20"  label="关注"></uv-icon>
													</uv-col>
													<uv-col span="3" customStyle="display: flex; justify-content: center; align-items: center;">
														<uv-count-to color="#ffffff" :startVal="0" :endVal="u_data.dianzan"></uv-count-to>

														<uv-icon name="thumb-up" color="#ffffff" labelColor="#ffffff" size="24"  label="点赞"></uv-icon>

													</uv-col>
													
												</uv-row>
												
												
											</view>
										</view>
										<view class="d-kuan d-buhuanhang">
											<view class="d-kuan d-beijing-baise">
												<uv-tabs :list="daohang_list" customStyle="background-color: #ffffff;" lineColor="#000000"  @click="quan_click"></uv-tabs>

											</view>

										</view>
										
									</view>
									<!---->
									<view class=" d-beijing-baise d-yuanjiao-0-10 d-bianhua-10">
										<view class="">
											<view class="d-kuan-25 d-zuo d-neirong-juzhong d-shangxia-10">
												<image src="/static/images/img/quanzi.png" class="d-img-50"></image>
												<view class="d-wenzi-14 ">圈子</view>
												<view class="d-wenzi-14 d-wenzi-yanse-hui">{{ u_data.quanzi }}个</view>
											</view>
											<view class="d-kuan-25 d-zuo d-neirong-juzhong d-shangxia-10">
												<image src="/static/images/img/fabu.png" class="d-img-50"></image>
												<view class="d-wenzi-14 ">帖子</view>
												<view class="d-wenzi-14 d-wenzi-yanse-hui">{{ u_data.tiezi }}条</view>
											</view>
											<view class="d-kuan-25 d-zuo d-neirong-juzhong d-shangxia-10">
												<image src="/static/images/img/shoucang.png" class="d-img-50"></image>
												<view class="d-wenzi-14 ">收藏</view>
												<view class="d-wenzi-14 d-wenzi-yanse-hui">{{ u_data.shoucang }}个</view>
											</view>
											<view class="d-kuan-25 d-zuo d-neirong-juzhong d-shangxia-10">
												<image src="/static/images/img/dianzan.png" class="d-img-50"></image>
												<view class="d-wenzi-14 ">点赞</view>
												<view class="d-wenzi-14 d-wenzi-yanse-hui">{{ u_data.dianzan }}个</view>
											</view>
											<view class="d-kuan-25 d-zuo d-neirong-juzhong d-shangxia-10 d-box">
												<image src="/static/images/img/pinglun.png" class="d-img-50"></image>
												<view class="box-you-1">
													 <u-badge :type="type" max="99"  bgColor="#e3310d"></u-badge>
												</view>
												<view class="d-wenzi-14 ">评论</view>
												<view class="d-wenzi-14 d-wenzi-yanse-hui">{{ u_data.pinglun }}个</view>
											</view>
											<view class="d-kuan-25 d-zuo d-neirong-juzhong d-shangxia-10">
												<image src="/static/images/img/duanxin.png" class="d-img-50"></image>
												<view class="d-wenzi-14 ">短信</view>
												<view class="d-wenzi-14 d-wenzi-yanse-hui">{{ u_data.duanxin }}个</view>
											</view>
											<view class="d-kuan-25 d-zuo d-neirong-juzhong d-shangxia-10" @click="chongzhi">
												<image src="/static/images/img/qianbao.png" class="d-img-50"></image>
												<view class="d-wenzi-14 ">钱包</view>
												<view class="d-wenzi-14 d-wenzi-yanse-hui">{{ u_data.wo && u_data.wo.money }}</view>
											</view>
											<view class="d-kuan-25 d-zuo d-neirong-juzhong d-shangxia-10">
												<image src="/static/images/img/goumai.png" class="d-img-50"></image>
												<view class="d-wenzi-14 ">已购买</view>
												<view class="d-wenzi-14 d-wenzi-yanse-hui">0个</view>
											</view>
											<!--view class="d-kuan-25 d-zuo d-neirong-juzhong d-shangxia-10" @click="lahei()">
												<image :src="domain+'/static/default/quan/img/pingbi.png'" class="d-img-50"></image>
												<view class="d-wenzi-14 ">拉黑</view>
												<view class="d-wenzi-14 d-wenzi-yanse-hui">管理</view>
											</view-->
											<view class="d-clear"></view>
																		  
										</view>
									</view>
									<!---->

							</view>
							<view class="pc-neikuang-20-list" >
								
							</view>
							
							<!--头部背景-->
							
							<view class="pc-neikuang-20" >
								<view class=" ">

								  
								  <!-- 基本数据 -->
								  
								  <!-- 助力/推荐/邀请 -->
								  <!--view class="margin-top-sm padding-lr-xs">
								    <view class="bg-brown light radius-lg shadow-blur">
								      <view class="flex padding-tb-sm padding-lr-sm justify-between">
								        <view class="padding-xs">
								          <view>9.9元开通超级会员最高可省￥40</view>
								        </view>
								        <view class="">
								          <view class="cu-btn round bg-black">开通会员</view>
								        </view>
								      </view>
								    </view>
								  </view-->
								  <!--view class="d-kuan">
								  	<view class="d-waikuang-10 d-wenzi-hei">
								  		<view class="d-kuan d-yuanjiao-10 d-beijing-bai">
								  			<view class="d-neikuang-10">
								  				<view class="d-kuan-33 d-zuo d-neirong-juzhong">
								  					<view>
								  						<image src="/static/images/img/xunzhang1.png"  class="d-img-50 "></image>
								  					</view>
								  					<view class="d-jiacu">
								  						我的积分
								  					</view>
								  					<view class="d-wenzi-14 d-wenzi-yanse-hui">{{yonghuXinxi.score}}积分</view>
								  				</view>
								  				<view class="d-kuan-33 d-zuo d-neirong-juzhong">
								  					<view>
								  						<image src="/static/images/img/jinbi.png" class="d-img-50"></image>
								  					</view>
								  					<view class="d-jiacu">
								  						积分商城
								  					</view>
								  					<view class="d-wenzi-14 d-wenzi-yanse-hui">兑换奖品</view>
								  				</view>
								  				<view class="d-kuan-33 d-zuo d-neirong-juzhong">
								  					<view>
								  						<image src="/static/images/img/qiandao.png" class="d-img-50"></image>
								  					</view>
								  					<view class="d-jiacu">
								  						每日签到
								  					</view>
								  					<view class="d-wenzi-14 d-wenzi-yanse-hui">有惊喜</view>
								  				</view>
								  				<view class="d-clear"></view>
								  			</view>
								  		</view>
								  	</view>
								  </view-->
								  <!--社区-->
								  <view class="d-kuan">
								  	<view class="d-waikuang-10 d-wenzi-hei">
								  		<view class="d-kuan d-yuanjiao-10 d-beijing-bai">
								  			
								  		</view>
								  	</view>
								  </view>
								  <!-- 常用功能 -->
								  
								
								  <!--view class="margin-top-sm padding-lr-xs">
								    <view class="bg-white light radius-lg shadow-blur">
								      <view class="flex padding-tb-sm padding-lr-sm justify-between">
								        <view class="padding-xs">
								          <view class="text-xl text-black">惊喜连连·洁净一秋</view>
								          <view class="padding-top-xs">家居清洗限时<text class="text-red text-bold"> 6.6折 </text><text class="cuIcon-roundrightfill text-red"></text></view>
								        </view>
								        <view class="">
								          <view class="cu-btn round bg-gradual-pinknew margin-top-sm">6折优惠</view>
								        </view>
								      </view>
								    </view>
								  </view-->
								  <!-- 其他功能 -->
								    <!--会员退出按钮-->
									<view class="d-kuan d-juzhong">
										<view class="cu-btn round bg-gradual-pinknew margin-top-sm" @click="tuichu">退出登录</view>
									</view>
									

								  
								
								</view>
							</view>
						</uv-col>
						<uv-col span="3" class="pc-yincang">
							<view class="d-daohang d-you-10 pc-yincang d-shang-20" id="zuo-daohang" :style="{height: leftNavHeight}">
								<view class="d-you-kuang">
									<!--view class="d-kuan  " id="yuedu_gao" :style="{height: leftNavHeight,width: rightColWidth,marginTop: '10px'}">
										<view class=" gundong-2"  style="height: 100%; display: flex; flex-direction: column;overflow-y: auto;">
											<view class="d-yuanjiao-10  d-beijing-e3 d-bianhua-10 ">
												<view class="d-kuan d-jiacu d-wenzi-16">
													站点资讯
												</view>
												<view class="d-hanggao-37 d-buhuanhang d-wenzi-16 d-quxian-0 d-chaochu d-shangxia-5">
													<view class="d-jiacu d-you-10 d-zitiyanse-hongse">1</view>
													<view data-id="20" data-toggle="modal" data-target="#myModalssss" class="tantie"> 
														Xiaomi 14 真机展示图					
													</view>
												</view>
												<view class="d-hanggao-37 d-buhuanhang d-wenzi-16 d-quxian-0 d-chaochu d-shangxia-5">
													<view class="d-jiacu d-you-10 d-zitiyanse-hongse">1</view>
													<view data-id="20" data-toggle="modal" data-target="#myModalssss" class="tantie"> 
														Xiaomi 14 真机展示图					
													</view>
												</view>

												<view class="d-hanggao-37 d-buhuanhang d-wenzi-16 d-quxian-0 d-chaochu d-shangxia-5">
													<view class="d-jiacu d-you-10 d-zitiyanse-hongse">1</view>
													<view data-id="20" data-toggle="modal" data-target="#myModalssss" class="tantie"> 
														Xiaomi 14 真机展示图					
													</view>
												</view>
												<view class="d-hanggao-37 d-buhuanhang d-wenzi-16 d-quxian-0 d-chaochu d-shangxia-5">
													<view class="d-jiacu d-you-10 d-zitiyanse-hongse">1</view>
													<view data-id="20" data-toggle="modal" data-target="#myModalssss" class="tantie"> 
														Xiaomi 14 真机展示图					
													</view>
												</view>


											</view-->
											<!--推荐圈子-->
											<!--view class="d-yuanjiao-10 d-waigao-20 d-beijing-e3 d-bianhua-10 ">
												<view class="d-kuan d-jiacu d-wenzi-16">
													推荐圈子
												</view>
												<uv-row customStyle="margin-bottom: 10px">
													<uv-col span="3" customStyle="display: flex; flex-direction: column; align-items: center;margin-top: 10px">
														<uv-avatar src="/static/img/011.jpg" shape="square"></uv-avatar>
														<view class="demo-layout bg-purple">321</view>
													</uv-col>
													<uv-col span="3" customStyle="display: flex; flex-direction: column; align-items: center;margin-top: 10px">
														<uv-avatar src="/static/img/011.jpg" shape="square"></uv-avatar>
														<view class="demo-layout bg-purple">321</view>
													</uv-col>
													<uv-col span="3" customStyle="display: flex; flex-direction: column; align-items: center;margin-top: 10px">
														<uv-avatar src="/static/img/011.jpg" shape="square"></uv-avatar>
														<view class="demo-layout bg-purple">321</view>
													</uv-col>
													<uv-col span="3" customStyle="display: flex; flex-direction: column; align-items: center;margin-top: 10px">
														<uv-avatar src="/static/img/011.jpg" shape="square"></uv-avatar>
														<view class="demo-layout bg-purple">321</view>
													</uv-col>


												</uv-row>


											</view-->
											<!--推荐课程-->
											<!--view class="d-yuanjiao-10 d-waigao-20 d-beijing-e3 d-bianhua-10 ">
												<view class="d-kuan d-jiacu d-wenzi-16">
													推荐课程
												</view>
												<uv-row customStyle="margin-bottom: 10px;flex-wrap: wrap">
													<uv-col span="6" customStyle="display: flex; flex-direction: column; align-items: center;margin-top: 10px">
														<view class="d-zuo d-tu-kuan-110 d-piaofu-0">

															<uv-image src="http://im.duixin.com/uploadfile/202507/86f3134bfebdfdf.jpg" width="190rpx" height="240rpx" radius="10"></uv-image>
														</view>

														<view class="demo-layout bg-purple">321</view>
													</uv-col>
													<uv-col span="6" customStyle="display: flex; flex-direction: column; align-items: center;margin-top: 10px">
														<view class="d-zuo d-tu-kuan-110 d-piaofu-0">

															<uv-image src="http://im.duixin.com/uploadfile/202507/86f3134bfebdfdf.jpg" width="190rpx" height="240rpx" radius="10"></uv-image>
														</view>

														<view class="demo-layout bg-purple">321</view>
													</uv-col>
													<uv-col span="6" customStyle="display: flex; flex-direction: column; align-items: center;margin-top: 10px">
														<view class="d-zuo d-tu-kuan-110 d-piaofu-0">

															<uv-image src="http://im.duixin.com/uploadfile/202507/86f3134bfebdfdf.jpg" width="190rpx" height="240rpx" radius="10"></uv-image>
														</view>

														<view class="demo-layout bg-purple">321</view>
													</uv-col>
													<uv-col span="6" customStyle="display: flex; flex-direction: column; align-items: center;margin-top: 10px">
														<view class="d-zuo d-tu-kuan-110 d-piaofu-0">

															<uv-image src="http://im.duixin.com/uploadfile/202507/86f3134bfebdfdf.jpg" width="190rpx" height="240rpx" radius="10"></uv-image>
														</view>

														<view class="demo-layout bg-purple">321</view>
													</uv-col>



												</uv-row>


											</view-->
											<!--底部-->
											<!--view class="d-kuan d-waigao-20 d-bianhua-10 "></view>																		
										</view>																								
									</view-->
								</view>
							</view>
						</uv-col>
					</uv-row>

					

				</view>
				<!--下面内容-->


			</view>

			<view class="d-clear"></view>
		
		</view>
		<!--底部-->
		<view class="d-kuan d-waigao-20 d-bianhua-10 pc-yincang"></view>

		<view class="d-clear pc-yincang"></view>
		<view class="d-weibu pc-yincang">
			<Dweibu></Dweibu>
		</view>

	</view>
</template>

<script>
    import Api from '@/utils/api.js'; 
	import QuanApi from '@/utils/quan_api.js';
	import UApi from '@/utils/u_api.js';
	import { getRequest,postRequest } from '@/utils/wxRequest.js';
    //引入组件 d-toubu
    import DToubu from '@/components/d-toubu/d-toubu.vue'
	import Ddaohang from '@/components/d-daohang/d-daohang.vue'
	import Dweibu from '@/components/d-weibu/d-weibu.vue'
	
	export default {
		data() {
			return {
				
				title: 'Hello',
				leftNavHeight: '500rpx', // 默认高度
                rightColWidth: '300px', // 默认宽度
				rightColLeft: '0px', // 添加这个属性
				daohang: [
					{
						id:'1',
						name: '首页', 
						icon: 'home',

					},
					{
						id:'2',
						name: '心理学',
						icon: 'home',
						erji: [	
							{id: '2-1', name: '情绪管理'},
					    	{id: '2-2', name: '心理疗愈'},
					    	{id: '2-3', name: '行为心理学'}
						]
					},
					
				],
				erjidata:[],
				erjiindex:'',//当前激活的二级菜单索引
				activeIndex: -1, // 当前激活的一级菜单索引
				zhishi_tuijian_data:[], // 知识推荐数据
				zhishi_daohang_list:[], // 知识导航列表
				zhishi_list:[], // 知识列表
				haibao_data:[], // 海报数据
				imageSize: {
        		    width: 0,
        		    height: 0
        		},
				tubiaolist: 
				['integral', 'kefuv-ermai', 'coupon', 'gift', 'scan',
					'pause-circle', 'volume-off', 'email', 'list'
				],
				denglu_xianshi:0, // 登录显示

				tiezi_list:[], // 帖子列表

				currentPage: 1, //下拉加载
    			pageSize: 12, //下拉加载
    			isLoading: false, //下拉加载
    			noMoreData: false, //下拉加载
				
				kuan_shu: 7, //格大小
				uid: '', // 用户ID - 初始化为空字符串，将在onLoad/onShow中设置
				swiperHeight: '250',
				gao: '20', //图片高度
				
				quan_data:[],
				
				shenhe_shu:0,//审核帖子数量
				u_data:[], // 用户信息
				dataLoaded: false,
			
				guanzhu_panduan:0,
				iconList: [{
				     icon: 'moneybagfill',
				     color: 'blue',
				     badge: 0,
				     name: '加入圈子'
				   }, {
				     icon: 'presentfill',
				     color: 'red',
				     badge: 0,
				     name: '购买知识',
				     bindtap: "bindZan"
				   }, {
				     icon: 'formfill',
				     color: 'purple',
				     badge: 11,
				     name: '充值',
				     bindtap: "showResource"
				   }, {
				     icon: 'shopfill',
				     color: 'green',
				     badge: 0,
				     name: '积分',
				     bindtap: "bindPoint"
				   }],
				   iconOtherList: [{
				     icon: 'location',
				     color: 'blue',
				     badge: 0,
				     name: '地址管理'
				   }, {
				     icon: 'service',
				     color: 'blue',
				     badge: 0,
				     name: '电话客服',
				     bindtap: "bindZan"
				   }, {
				     icon: 'mark',
				     color: 'blue',
				     badge: 0,
				     name: '在线客服',
				     bindtap: "showResource"
				   }, {
				     icon: 'mail',
				     color: 'blue',
				     badge: 0,
				     name: '投诉',
				     bindtap: "bindCollect"
				   }, {
				     icon: 'settings',
				     color: 'blue',
				     badge: 0,
				     name: '设置',
				     bindtap: "bindZan"
				   }]



			}
		},
		components: {
  		    DToubu,
			Ddaohang,
			Dweibu
  		},
		mounted() {
			// 确保在组件挂载后更新uid
			console.log('Component mounted, checking uid...');
			const storeUid = this.$store.state.memberuid;
			if (storeUid && !this.uid) {
				this.uid = storeUid;
				console.log('UID set from store in mounted:', this.uid);
			}
			
    	    this.setLeftNavHeight();
			this.getRightColWidth(); // 添加这行
    	    // 添加窗口大小变化监听
    	    window.addEventListener('resize', this.setLeftNavHeight);
			window.addEventListener('resize', this.getRightColWidth); // 添加窗口大小变化监听
			var e = this;
			//this.onImageLoad(e);
    	},
    	beforeDestroy() {
    	    // 移除监听
    	    window.removeEventListener('resize', this.setLeftNavHeight);
			window.removeEventListener('resize', this.getRightColWidth); // 添加这行
    	},
		onShow() {
			console.log('Component shown, updating uid...');
			const storeUid = this.$store.state.memberuid;
			console.log('Store memberuid:', storeUid);
			this.uid = storeUid;
			console.log('UID set in onShow:', this.uid);

			if(!storeUid){
				console.log('No uid in store, showing login prompt');
				this.denglu_xianshi = 1;
				this.godenglu(); // 暂时注释掉自动跳转，便于调试
			}

			//this.getShenhe_shu_api();
			
		},
		onLoad(e) {
			console.log('Component loaded with params:', e);
			// 优先使用路由参数中的uid
			if (e && e.uid) {
				this.uid = e.uid;
				console.log('UID set from route params:', this.uid);
			} else {
				// 如果路由参数中没有uid，则从store获取
				const storeUid = this.$store.state.memberuid;
				if (storeUid) {
					this.uid = storeUid;
					console.log('UID set from store in onLoad:', this.uid);
				} else {
					console.log('No uid available in route params or store');
				}
			}
			
			// 只有在有uid的情况下才调用API
			if (this.uid) {
				this.getu_api();
			} else {
				console.warn('Cannot call getu_api: uid is not available');
			}
			
		},
		computed: {
		  yidenglu() {
		    return (this.$store.state.memberuid && this.$store.state.keycode) ? 1 : 0;
		  },
		  touxiang() {
		    return this.$store.state.member? this.$store.state.member.avatar : '';
		  },
		  name1() {
		    return this.$store.state.member? this.$store.state.member.name : '';
		  }
		},
		onReachBottom() {
  			this.onReachBottom(); //下拉加载分页
  		},

		methods: {
			//图片
			onImageLoad(e, index) {
				// 获取系统信息
				const systemInfo = uni.getSystemInfoSync();
        	    // 计算可用高度（可根据实际需求调整计算方式）
        	    const windowHeight = systemInfo.windowWidth;
				if(windowHeight >=920){
					var gao = 30;
					
				} else {
					var gao = 0;
				}


				this.$nextTick(() => {
        		    const query = uni.createSelectorQuery().in(this);
        		    query.select('#tupian-'+index).boundingClientRect(data => {
        		        if (data && data.width > 0 && data.height > 0) {
        		            this.$set(this.haibao_data[index], 'imageSize', {
        		                width: data.width,
        		                height: data.height + gao
        		            });
							console.log('图片尺寸:', this.haibao_data[index].imageSize);
        		        } else {
        		            console.warn(`图片${index}尺寸获取失败`);
        		            this.$set(this.haibao_data[index], 'imageSize', {
        		                width: 300,
        		                height: 200
        		            });
        		        }
        		    }).exec();
        		});

    		},
			getRightColWidth() {
				// 获取系统信息
				const systemInfo = uni.getSystemInfoSync();
        	    // 计算可用高度（可根据实际需求调整计算方式）
        	    const windowWidth = systemInfo.windowWidth;
				var d = this;

                this.$nextTick(() => {
				if(windowWidth >=1221){
					d.gao = 20;
					d.kuan_shu = 7;
					d.swiperHeight = '250';
				} else {
					d.gao = 10;
					d.kuan_shu = 12;
					d.swiperHeight = '120';

				}
				console.log('窗口高度:', windowWidth);

                 const query = uni.createSelectorQuery().in(this);
                 query.select('#youbiankuan').boundingClientRect(rect => {
                   if (rect) {
                     /*this.rightColWidth = `${rect.width+20}px`;
                     console.log('右侧列宽度:', this.rightColWidth);*/
					 	this.rightColWidth = `${rect.width-80}px`;
                    	this.rightColLeft = `${rect.left}px`; // 计算左侧位置
                    	console.log('右侧列位置:', this.rightColWidth);
                   }
                 }).exec();
               });
            },

			//首页
			shouye(){
				uni.navigateTo({
					url: '/pages/index/index',
					fail: (err) => {
						console.error('跳转失败:', err)
					}
				})
			},
			
			setLeftNavHeight() {
        	    // 获取系统信息
        	    const systemInfo = uni.getSystemInfoSync();
        	    // 计算可用高度（可根据实际需求调整计算方式）
        	    const windowHeight = systemInfo.windowHeight;
        	    const headerHeight = 70; // 头部高度估计值
        	    const calculatedHeight = windowHeight - headerHeight;
				
        	    // 设置左边导航高度
        	    this.leftNavHeight = `${calculatedHeight}px`;
        	},
			
			
			handleLoginSuccess() {
  			  this.$forceUpdate();
  			},
			
			
			
			
			denglu_fabu(){
				if(this.yidenglu == 0){
					this.denglu_xianshi = 1;
					
				} else {
					this.denglu_xianshi = 0;
						
				}
				
				console.log('发布登录',this.denglu_xianshi);
				
			},
			// 更新判断是否登录
			handleUpdateDengluxianshi(value) {
			  this.denglu_xianshi = value;
			  
			  console.log('关闭登录',this.denglu_xianshi);
			},
			// 退出登录
			handleLogout() {
 			  
 			  this.godenglu(); // 暂时注释掉自动跳转，便于调试
			   
 			},
			
			
			
			
			
			//个人信息
			getu_api(){
				console.log('Calling getu_api with uid:', this.uid);
				var uid = this.$store.state.memberuid;
				var keycode = this.$store.state.keycode;
				const data = {
						uid: this.uid,
						api_auth_uid: this.uid,
						api_auth_code: keycode,
					}
				var get_data = getRequest(UApi.getU(),data);
				var res;
				get_data.then(duixin_data => {
					res = duixin_data;
					if(res.data.code) {
						if(this.uid){
							//this.u_data = res.data.data.wo;
						} else {
							//this.u_data = res.data.data.u;
						}
						this.u_data = res.data.data;
						//this.u_data = res.data.data;
						this.dataLoaded = true;
						
					}
				})

			},
			//跳转个人信息
			godenglu(){
				//保持url到缓存，名称是u_url
				uni.setStorageSync('go_url', this.$route.fullPath);
				uni.navigateTo({
					url: '/pages/u/denglu',
				})
			},

			
			
			// 返回
            fanhui() {
				// 先清理音频
				
               // 获取页面栈
                 const pages = getCurrentPages();
                 // 如果页面栈长度小于等于1，说明没有上一级页面
                 if (pages.length <= 1) {
                    console.log('没有上一级页面');
                    uni.reLaunch({
                      url: '/pages/index/index'
                    });
                 } else {
                    // 有上一级页面则返回
                    uni.navigateBack({
                      delta: 1
                    });
                }
            },
			tuichu(){
				uni.showToast({
					title: "退出成功",
					icon: 'success',
					
				})

				uni.removeStorageSync('userInfo');
				uni.removeStorageSync('memberuid');
				uni.removeStorageSync('keycode');
				uni.removeStorageSync('member');
				// 通过 mutations 更新 Vuex 状态
				this.$store.commit('setMember', {});
    			this.$store.commit('setMemberUid', '');
    			this.$store.commit('setKeycode', '');
				//this.yidenglu = 0;
				// 触发退出事件
				this.$emit('logout-success');
				//退出跳转到首页
				uni.reLaunch({ url: "/pages/index/index" });
			},
			shezhi(){
				//
				uni.navigateTo({
					url: '/pages/u/shezhi',
				})
			}





		}
	}
</script>

<style>
/*引入css main.css*/

	.content {
		
		
		display: flex;
		flex-direction: column;
		/*align-items: center;*/
		
		background-color: #f3f3f3;
		
		margin-bottom: 0px;
		
		/*height: 100vh;*//* 添加全屏 */
		/*width: 100vw;*/ /* 添加全屏*/
		box-sizing: border-box;
		overflow-x: hidden;

		
		

	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
	/* 屏幕宽度大于786px时隐藏uni-page-head */
    @media (min-width: 786px) {
        uni-page-head {
            display: none !important;
            opacity: 0 !important;
            height: 0 !important;
            visibility: hidden !important;
        }
    }
	/*.d-daohang{
		
		width: 600rpx;
	}*/
	/* 添加在style部分 */
	.d-daohang-zuo {
    position: fixed;
    left: 0;
    
    width: 180rpx;
    height: calc(100vh - 70rpx);
    background: #f5f5f5;
    z-index: 100;
	box-shadow: 2px 0 5px rgba(177, 177, 177, 0.1);
  }
  
  .d-daohang-you {
    position: fixed;
    left: 180rpx;
    
    width: 180rpx;
    height: calc(100vh - 70rpx);
    background: #fff;
    z-index: 100;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
  }
   
   
   
   
   
   
   
   
   
 
   
  .d-erji-item {
    height: 60rpx;
    line-height: 60rpx;
    padding: 0 20rpx;
   /* border-bottom: 1px solid #f0f0f0;*/
  }
  
  .d-erji-item:active {
    background: #f5f5f5;
  }
  .you-guding {
	position: fixed;
	top: 0; /* 根据头部高度调整 */
	/*box-shadow: -2px 0 5px rgba(0,0,0,0.1);*/
	transition: all 0.3s ease;
}
/* 大于786px时的样式 */
@media screen and (min-width: 1024px) {
	.d-bianhua-10 {
		padding: 30px;
	}
	.pc-zuo-520 {
		margin-left: 520rpx;
	}
	.you-guding {
		position: fixed;
			
		top: 60px; /* 根据头部高度调整 */
		/*box-shadow: -2px 0 5px rgba(0,0,0,0.1);*/
		transition: all 0.3s ease;
	}
		
	
}
	
</style>
